package cn.yunhe.dubbo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.config.annotation.Reference;
import cn.yunhe.dubbo.IOrderService;

@RestController
public class OrderController {

	@Reference(url="127.0.0.1:8089")
	private IOrderService orderService;
	
	@RequestMapping("/order/get")
	public String getOrder(){
		System.out.println(11);
		//ApplicationContext ac2 = WebApplicationContextUtils.getWebApplicationContext(); 
		String rs = orderService.getOrder("222");
		System.out.println(rs);
		//int a=orderService.addOrder("hello");
		return rs;
	}
	
	@RequestMapping("/order/add")
	public String addOrder(){
		System.out.println(22);
		Integer a=orderService.addOrder("hello");
		return a.toString();
	}
	
}
